package com.hd.service.test;

import java.util.Calendar;
import java.util.List;

import com.hd.common.DataPage;
import com.hd.persistence.model.AcceptTreatmentCase;
import com.hd.utils.HdException;

public class AcceptTreatmentCaseManagerTestCase extends BaseTest {
	
	//保存实体
//	public void testSaveAcceptTreatmentCase() throws HdException {
//		for ( int i = 0; i < 10; i++ ) {
//			AcceptTreatmentCase atc = new AcceptTreatmentCase();
//			atc.setAcceptTreatmentTime(2233);
//			atc.setAcceptTreatmenter("受理人" + i);
//			atc.setUnitName("受理单位" + i);
//			atc.setUnitForshort("dwjc" + i);
//			atc.setContactor("联系人" + i);
//			atc.setContactWay("0510-85910687");
//			atc.setAddress("无锡市");
//			atc.setMachineNo("46313153" + i );
//			atc.setMachineModel("OOXX3");
//			atc.setContent("受理内容");
//			atc.setCreateTimestamp(3366);
//			repairManager.saveAcceptTreatmentCase(atc);
//		}
//	}
	
	//分页查询
	public void testPageQueryAcceptTreatmentCases() throws HdException {
		Calendar c = Calendar.getInstance();
		c.set(Calendar.HOUR_OF_DAY, 0);
		c.set(Calendar.MINUTE, 0);
		c.set(Calendar.SECOND, 0);
		c.set(Calendar.MILLISECOND, 0);
		DataPage<AcceptTreatmentCase> dataPage = repairManager.pageQueryAcceptTreatmentCases("", "", c.getTime(), 1, 100);
		System.out.println("查询总数为:" + dataPage.getTotalCount());
		List<AcceptTreatmentCase> atcs = dataPage.getData();
		for ( AcceptTreatmentCase atc : atcs ) {
			System.out.println(atc.getAcceptTreatmentCaseId() + " " + atc.getAcceptTreatmenter());
		}
		
	}
	
}
